﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Web;
using UnityEngine.Networking;
using Newtonsoft.Json;

public class LoadingControl : MonoBehaviour
{
	void Awake ()
	{
		// load du lieu thong so monster 
		LoadMonsterData ();
	}

	// load data cac level
	public static void LoadLevelsData ()
	{
		TextAsset ta = Resources.Load ("datalevels") as TextAsset;
		//Debug.Log (ta.text);

		GameManager.levelDict = JsonConvert.DeserializeObject<Dictionary<string, object>> (ta.text);

	}
	// load thong so monster
	public static void LoadMonsterData ()
	{
		TextAsset ta = Resources.Load ("datamonster") as TextAsset;
		//Debug.Log (ta.text);

		GameManager.enemyDict = JsonConvert.DeserializeObject<Dictionary<string, object>> (ta.text);

	}
	// load data card
	public static void LoadCardData ()
	{
		TextAsset ta = Resources.Load ("datacartas") as TextAsset;
		//Debug.Log (ta.text);

		GameManager.cardDict = JsonConvert.DeserializeObject<Dictionary<string, object>> (ta.text);

	}
}

[System.Serializable]
public class MonsterModule
{
	public int id;
	public Character characterControl;
	public string type;
	public int hp;
	public int atk;
	public int turn;
	public string spriterName;
	public string audioNam;
	public bool powerTurn;
}


